<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Normalizes the input provided and returns the normalized string</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="normalizer.isnormalized.html">Normalizer::isNormalized</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.messageformatter.html">MessageFormatter</a></div>
 <div class="up"><a href="class.normalizer.html">Normalizer</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="normalizer.normalize" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Normalizer::normalize</h1>
  <h1 class="refname">normalizer_normalize</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Normalizer::normalize</span> -- <span class="refname">normalizer_normalize</span> &mdash; <span class="dc-title">
   Normalizes the input provided and returns the normalized string
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-normalizer.normalize-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
   <div class="methodsynopsis dc-description">
    <span class="modifier">public</span>
    <span class="modifier">static</span>
    <span class="type">string</span> 
    <span class="methodname"><strong>Normalizer::normalize</strong></span>
     ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$input</code></span>
    [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$form</code><span class="initializer"> = Normalizer::FORM_C</span></span>
   ] )</div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> 
   <span class="methodname"><strong>normalizer_normalize</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$input</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$form</code><span class="initializer"> = Normalizer::FORM_C</span></span>
  ] )</div>

  <p class="para rdfs-comment">Normalizes the input provided and returns the normalized string</p>
 </div>


 <div class="refsect1 parameters" id="refsect1-normalizer.normalize-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">input</code></em></dt>

     <dd>

      <p class="para">The input string to normalize</p>
     </dd>

    
    
     <dt>
<em><code class="parameter">form</code></em></dt>

     <dd>

      <p class="para">One of the normalization forms.</p>
     </dd>

    
   </dl>

  </p>
 </div>



 <div class="refsect1 returnvalues" id="refsect1-normalizer.normalize-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">The normalized string or <strong><code>NULL</code></strong> if an error occurred.</p>
 </div>


 <div class="refsect1 examples" id="refsect1-normalizer.normalize-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-2504">
   <p><strong>Example #1 
    <span class="function"><strong>normalizer_normalize()</strong></span> example
   </strong></p>
   <div class="example-contents">
    <div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$char_A_ring&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"\xC3\x85"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;'LATIN&nbsp;CAPITAL&nbsp;LETTER&nbsp;A&nbsp;WITH&nbsp;RING&nbsp;ABOVE'&nbsp;(U+00C5)<br /></span><span style="color: #0000BB">$char_combining_ring_above&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"\xCC\x8A"</span><span style="color: #007700">;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;'COMBINING&nbsp;RING&nbsp;ABOVE'&nbsp;(U+030A)<br />&nbsp;<br /></span><span style="color: #0000BB">$char_1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">normalizer_normalize</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$char_A_ring</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Normalizer</span><span style="color: #007700">::</span><span style="color: #0000BB">FORM_C&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$char_2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">normalizer_normalize</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">'A'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$char_combining_ring_above</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Normalizer</span><span style="color: #007700">::</span><span style="color: #0000BB">FORM_C&nbsp;</span><span style="color: #007700">);<br />&nbsp;<br />echo&nbsp;</span><span style="color: #0000BB">urlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">$char_1</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">'&nbsp;'</span><span style="color: #007700">;<br />echo&nbsp;</span><span style="color: #0000BB">urlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">$char_2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

  </div>
  <div class="example" id="example-2505">
   <p><strong>Example #2 OO example</strong></p>
   <div class="example-contents">
    <div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$char_A_ring&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"\xC3\x85"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;'LATIN&nbsp;CAPITAL&nbsp;LETTER&nbsp;A&nbsp;WITH&nbsp;RING&nbsp;ABOVE'&nbsp;(U+00C5)<br /></span><span style="color: #0000BB">$char_combining_ring_above&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"\xCC\x8A"</span><span style="color: #007700">;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;'COMBINING&nbsp;RING&nbsp;ABOVE'&nbsp;(U+030A)<br />&nbsp;<br /></span><span style="color: #0000BB">$char_1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Normalizer</span><span style="color: #007700">::</span><span style="color: #0000BB">normalize</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$char_A_ring</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Normalizer</span><span style="color: #007700">::</span><span style="color: #0000BB">FORM_C&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$char_2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Normalizer</span><span style="color: #007700">::</span><span style="color: #0000BB">normalize</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">'A'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$char_combining_ring_above</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Normalizer</span><span style="color: #007700">::</span><span style="color: #0000BB">FORM_C&nbsp;</span><span style="color: #007700">);<br />&nbsp;<br />echo&nbsp;</span><span style="color: #0000BB">urlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">$char_1</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">'&nbsp;'</span><span style="color: #007700">;<br />echo&nbsp;</span><span style="color: #0000BB">urlencode</span><span style="color: #007700">(</span><span style="color: #0000BB">$char_2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

  </div>
  <p class="para">以上例程会输出：</p>
  <div class="example-contents screen">
   <div class="cdata"><pre>
%C3%85 %C3%85
</pre></div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-normalizer.normalize-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="normalizer.isnormalized.html" class="function" rel="rdfs-seeAlso">normalizer_is_normalized()</a> - Checks if the provided string is already in the specified normalization
   form.</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="normalizer.isnormalized.html">Normalizer::isNormalized</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.messageformatter.html">MessageFormatter</a></div>
 <div class="up"><a href="class.normalizer.html">Normalizer</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
